package com.shuyan.base.algorithm;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.concurrent.locks.Lock;

public class Exercise06 {
    public static void main(String[] args) throws ParseException {
        Date date=new Date();
        SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
        SimpleDateFormat sdf2=new SimpleDateFormat("yyyy-MM-dd HH-mm-ss");
        Date date2=sdf.parse("2021-04-02");
        int result=date.compareTo(date2);
        System.out.println(result);
        long s1=date.getTime();
        long s2=date2.getTime();
        System.out.println("s1:"+s1);
        System.out.println("s2:"+s2);
        Date date_1=new Date(s1);
        Date date_2=new Date(s2);
        System.out.println("date1:"+sdf2.format(date_1));
        System.out.println("date2:"+sdf2.format(date_2));
        // \u000d System.out.println("我是注释");
        Float a=null;
        a.toString();
    }
}
